package tr.edu.ege.kipler.satisfiability.completion.rules.nondeterminism;

import tr.edu.ege.kipler.satisfiability.UnsatisfiableException;
import tr.edu.ege.kipler.satisfiability.container.WorldConstraintSystem;

/**
 * 
 * @author İnanç Seylan
 *
 */
public class LinearBranchingPoint extends BranchingPoint {
	private int accessCount;

	public LinearBranchingPoint(WorldConstraintSystem wcs) {
		setWcs(wcs);
	}

	@Override
	public boolean hasNext() {
		return getWcs() != null && accessCount == 0;
	}

	@Override
	public WorldConstraintSystem next() throws UnsatisfiableException {
		WorldConstraintSystem result = null;
		if (hasNext()) {
			accessCount++;
			result = getWcs();
		}
		return result;
	}

}
